<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>  
<!DOCTYPE html>
<html  ng-app="myApp">
   <head>
        <script src="/website/resources/angular.min.js"></script>
        <script src="/website/resources/angularJS.js/demo.js"></script>
        <link href="/website/resources/angularJS.js/demo.css" rel="stylesheet" type="text/css"/>
   </head>
   <body>
    <div ng-controller="myController" ng-init="init()">
      <form name="myForm" ng-submit="alertOk()" action="/website/user/changePwd" method="post">
          <div>  
              <label for="name">用户名:</label><br>
    <input type="text" name="name" value="${users.name}"><br>
   
     <input type="text" id="pwd" ng-model="pwd" required name="pwd" id="pwd" value="${users.pwd}"><br>
          </div>  
          <div>  
              <label for="pwd3">输入原密码:</label>
              <input type="password" ng-model="pwd3" required name="pwd3"  id="pwd3" placeholder="请输入密码" ng-pattern="pwd"></p>
              <div ng-if="myForm.pwd3.$dirty && myForm.pwd3.$error.required" class="errorinfo labelmargin">密码必须填写</div>
              <div ng-if="myForm.pwd3.$dirty && myForm.pwd3.$error.pattern" class="errorinfo labelmargin">第一个字符必须是大写字母，第二个字符必须是“.”、"_"、"@"其中一个，剩下为大小写字母或者数字。最少6个字符，最多20个字符。</div>
          </div>          
          <div>  
              <label for="pwd1">输入新密码:</label>
              <input type="password" ng-model="pwd1" required name="pwd1"  id="pwd1" placeholder="请输入密码" ng-pattern="/^[A-Z][\_\@\.]([a-zA-Z0-9]){4,18}$/"></p>
              <div ng-if="myForm.pwd1.$dirty && myForm.pwd1.$error.required" class="errorinfo labelmargin">密码必须填写</div>
              <div ng-if="myForm.pwd1.$dirty && myForm.pwd1.$error.pattern" class="errorinfo labelmargin">第一个字符必须是大写字母，第二个字符必须是“.”、"_"、"@"其中一个，剩下为大小写字母或者数字。最少6个字符，最多20个字符。</div>
          </div>          
          <div>  
              <label for="pwd2">确认新密码:</label>
              <input type="password" ng-model="pwd2" required name="pwd2"  id="pwd2" placeholder="请输入密码" ng-pattern="pwd1"></p>
              <div ng-if="myForm.pwd2.$dirty && myForm.pwd2.$error.required" class="errorinfo labelmargin">密码必须填写</div>
              <div ng-if="myForm.pwd2.$dirty && myForm.pwd2.$error.pattern" class="errorinfo labelmargin">输入的密码不同</div>
          </div>          
          <input type="submit" value="修改" id="submitbtn" ng-disabled="myForm.$invalid" class="labelmargin"/>
      		<a href="/website/user/login">返回登录界面</a>
      </form>
    </div>
    </body>
</html>